package com.util;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
//可以使用配置文件下（如 application.properties 或  自定义配置文件）http下的属性
@ConfigurationProperties(prefix = "http")
//使用自定义新建的配置文件
@PropertySource("classpath:setting.properties")
public class HttpClientConfig {
	/**
	 * 设置等待数据超时时间 根据业务调整
	 */
	private int socketTimeout;
	/**
	 * 连接超时
	 */
	private int connectTimeout;
	/**
	 * 连接池最大连接数
	 */
	private int poolSize;
	/**
	 * 每个主机的并发最多数
	 */
	private int maxPerRoute;
	public int getSocketTimeout() {
		return socketTimeout;
	}
	public void setSocketTimeout(int socketTimeout) {
		this.socketTimeout = socketTimeout;
	}
	public int getConnectTimeout() {
		return connectTimeout;
	}
	public void setConnectTimeout(int connectTimeout) {
		this.connectTimeout = connectTimeout;
	}
	public int getPoolSize() {
		return poolSize;
	}
	public void setPoolSize(int poolSize) {
		this.poolSize = poolSize;
	}
	public int getMaxPerRoute() {
		return maxPerRoute;
	}
	public void setMaxPerRoute(int maxPerRoute) {
		this.maxPerRoute = maxPerRoute;
	}
	
	
	// http代理相关参数
	private String proxyHost;
	private int proxyPort;
	private String proxyUsername;
	private String proxyPassword;
	public String getProxyHost() {
		return proxyHost;
	}
	public void setProxyHost(String proxyHost) {
		this.proxyHost = proxyHost;
	}
	public int getProxyPort() {
		return proxyPort;
	}
	public void setProxyPort(int proxyPort) {
		this.proxyPort = proxyPort;
	}
	public String getProxyUsername() {
		return proxyUsername;
	}
	public void setProxyUsername(String proxyUsername) {
		this.proxyUsername = proxyUsername;
	}
	public String getProxyPassword() {
		return proxyPassword;
	}
	public void setProxyPassword(String proxyPassword) {
		this.proxyPassword = proxyPassword;
	}
	
	
}